<template>
  <div>
    <div class="father">
      <div @click="current = item" :class="current === item ? 'son-focus' : ''" class="son" v-for="(item, index) in 11">
        {{index}}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "YHome",
  data() {
    return {
      current: 0,
      keywords: "",
      types: [],
      activeName: "",
      data: [],
      blocks: [
        {
          img: require('../assets/block1.png'),
          title: '国际化设备',
          en: 'Internation Standard'
        },
        {
          img: require('../assets/block2.png'),
          title: '专家团队',
          en: 'Experienced Medical Team'
        },
        {
          img: require('../assets/block3.png'),
          title: '体检环境',
          en: 'Examination Environment'
        },
        {
          img: require('../assets/block4.png'),
          title: '质控体系',
          en: 'Heaith Examination'
        },
      ],
      menus: [
        {
          img: require('../assets/menu1.png'),
          router: 'news'
        },
        {
          img: require('../assets/menu2.png'),
          router: 'knowledge',
        },
        {
          img: require('../assets/menu3.png'),
          router: 'square',
        },
        {
          img: require('../assets/menu4.png'),
          router: 'admin',
        },
      ],
      swipeList: [
        {
          img: require('../assets/swipe1.png')
        },
        {
          img: require('../assets/swipe2.png')
        }
      ]
    };
  },
  methods: {
    navigate(item) {
      if (item.router === 'admin') {
        window.open('http://localhost:8080/')
      } else {
        this.$router.push(`/${item.router}`);
      }
    },
    link() {
      this.$router.push(`/knowledge`);
    }
  },
};
</script>

<style lang="scss" scoped>
.father {
  width: 500px;
  height: 50px;
  display: flex;
  box-sizing: border-box;

  .son {
    width: 50px;
    height: 50px;
    border: 1px solid green;
    border-right: unset;
    text-align: center;
    line-height: 50px;
  }

  .son:last-child {
    border-right: 1px solid green;
  }


  .son-focus {
    background: green;
  }
}
</style>
